<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" href="style.css" />
	</head>

	<body>

		<div id="app" v-cloak>
			<div class="container">
				<span id="message">{{ msg | json }}</span>
			</div>
			<div class="container">
				<div class="form-group">
					<label>电子邮箱</label>
					<input type="text" v-model="registerModel.email" />
				</div>
				<div class="form-group">
					<label>密码</label>
					<input type="text" v-model="registerModel.password" />
				</div>

				<div class="form-group">
					<label>确认密码</label>
					<input type="text" v-model="registerModel.confirmPassword" />
				</div>

				<div class="form-group">
					<label></label>
					<button @click="register">注册</button>
				</div>
			</div>
		</div>
	</body>
	<script src="js/vue.js"></script>
	<script src="js/vue-resource.js"></script>

	<script>
		Vue.http.options.emulateJSON = true
		var demo = new Vue({
			el: '#app',
			data: {
				registerUrl: 'http://211.149.193.19:8100/api/Account/Register',
				registerModel: {
					email: '',
					password: '',
					confirmPassword: ''
				},
				msg: ''
			},
			methods: {
				register: function() {
					this.$http.post(this.registerUrl, this.registerModel)
						.then((response) => {
							this.msg = '注册成功！'
						}).catch((response) => {
							this.msg = response.json()
						})
				}
			}
		})
	</script>

</html>